Micron Document
🎖️GitЯра🎖️

Node / meshtastic / Meshtastic-Android / files / androidApp / src / testGoogle / kotlin / org / meshtastic / app / map / KmlParserLinkageTest.kt

Displaying Raw • Download

androidApp/src/testGoogle/kotlin/org/meshtastic/app/map/KmlParserLinkageTest.kt bd2863243bab6eb213401d949839a2bc74dde7e2 (bd286324) Text, 2.14 KB

T8b949e/*
* Copyright (c) 2026 Meshtastic LLC
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
Tff7b72package T7ee787org.meshtastic.app.map

Tff7b72import T7ee787com.google.maps.android.data.parser.kml.KmlParser
Tff7b72import T7ee787kotlin.test.Test
Tff7b72import T7ee787kotlin.test.assertNotNull

T8b949e/**
* Canary for the android-maps-utils / xmlutil linkage behind KML map overlays.
*
* android-maps-utils' `data.parser` KmlParser and the app's CoT XML code share one resolved xmlutil, and the pairing
* has already broken in production once: maps-utils 5.0.0 was compiled against xmlutil 0.91.x's removed
* `XmlConfig.Builder.policyBuilder()`, so when the app moved to xmlutil 1.0.x (2.8.0) every KML/KMZ import crashed with
* a fatal `NoSuchMethodError` until the maps-utils floor was raised to 5.1.1 (built against 1.0.x's compat builder).
* Whichever side a future dependency bump moves first, this test fails the build on the resulting binary mismatch
* instead of leaving it to be discovered by users opening map overlays.
*/
Tff7b72class T56d364KmlParserLinkageTest Tb4b4b4{

Tf0883e@Test
Tff7b72fun Td2a8ffkmlParserParsesAMinimalDocumentAgainstTheResolvedXmlutilTb4b4b4(Tb4b4b4) Tb4b4b4{
Tff7b72val Te6edf3kml Tff7b72=
Ta5d6ff"""
Ta5d6ff <?xml version=Ta5d6ff"Ta5d6ff1.0Ta5d6ff"Ta5d6ff encoding=Ta5d6ff"Ta5d6ffUTF-8Ta5d6ff"Ta5d6ff?>
<kml xmlns=Ta5d6ff"Ta5d6ffhttp://www.opengis.net/kml/2.2Ta5d6ff"Ta5d6ff>
<Placemark>
<name>linkage-canary</name>
<Point><coordinates>-122.084,37.421,0</coordinates></Point>
</Placemark>
</kml>
Ta5d6ff"""
Tb4b4b4.Te6edf3trimIndentTb4b4b4(Tb4b4b4)

Te6edf3assertNotNullTb4b4b4(Te6edf3KmlParserTb4b4b4(Tb4b4b4)Tb4b4b4.Te6edf3parseTb4b4b4(Te6edf3kmlTb4b4b4.Te6edf3byteInputStreamTb4b4b4(Tb4b4b4)Tb4b4b4)Tb4b4b4)
Tb4b4b4}
Tb4b4b4}

Served by rngit 1.5.0 - Generated in 0.06s